package com.bailian.spring.ioc.basic_beanFactory.factory;

import com.bailian.spring.ioc.basic_beanFactory.bean.Ball;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author gaoxu
 * date: Created on 2021/11/1 下午2:20
 */
public class BallFactoryBean implements FactoryBean<Ball> {

    public BallFactoryBean() {
        System.out.println("BallFactoryBean 初始化....");
    }

    @Override
    public Ball getObject() throws Exception {
        Ball ball = new Ball();
        ball.setName("小皮球");
        return ball;
    }

    @Override
    public Class<?> getObjectType() {
        return Ball.class;
    }
}
